# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=immer
pkgver=0.8.1
pkgrel=0
pkgdesc="Postmodern immutable and persistent data structures for C++ — value semantics at scale"
url="https://sinusoid.es/immer"
arch="noarch"
license="BSL-1.0"
makedepends="
	catch2
	cmake
	samurai
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/arximboldi/immer/archive/refs/tags/v$pkgver.tar.gz"
options="!check" # Calls test executables unconditionally if they have been built or not

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
3a9aafeb5daad1881d00fb999b78f86b1c8f0e8ef2d6befe9025d8eea10392557ce7186f14878b36cbce0f2f5d38c8ffb39c9115a9496803acfc0ef2289f5cbf  immer-0.8.1.tar.gz
"
